﻿namespace iRealtor.Maps.DataAccess.Dao
{
	public class MySqlDaoFactory
	{
		private string GetCurrentConnectionString()
		{
			return Config.Config.CURRENT_CONNECTION_STRING;
		}

		public IDao CreateDao()
		{
			var dao = CreateNewDao(GetCurrentConnectionString());
			return dao;
		}

		private IDao CreateNewDao(string connectionString)
		{
			if (!string.IsNullOrEmpty(connectionString))
			{
				return new MySqlDao(connectionString);
			}
			return null;
		}
	}
}
